<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <meta http-equiv="X-UA-Compatible" content="ie=edge">
  <link rel="stylesheet" href="/index.css">
  <link rel="stylesheet" href="/init.css">
  <title>移动</title>
  <style>
    div {
      position: absolute;
      top: 320px;
      left: 400px;
      width: 100px;
      height: 200px;
      background-color: red;
    }

  </style>
</head>

<body>
  <button>移动</button>
  <button>抖动</button>
  <div></div>
  <script src="move.js"></script>
  <script>
    var oDiv = document.getElementsByTagName('div')[0];
    var aBtn = document.getElementsByTagName('button');

    aBtn[0].onclick = function() {
      doMove(oDiv, 'top', 10, 800, 20)
    }

    aBtn[1].onclick = function() {
      doShake(oDiv, 'left');
    }
  </script>
</body>

</html>
